import type { ArticleDetailType, PublishDataType, UploadResponseType } from "@/types/publish"
import { request } from "@/utils/request"

// 发布文章
export const publishApi = (data: PublishDataType, draft: boolean) => {
 return request<null>('/v1_0/mp/articles?draft='+ draft ,'POST', data)
}

// 获取文章详情
export const getArticleDetailApi = (id: string) => {
  return request<ArticleDetailType>( `/v1_0/mp/articles/${id}`
  )
}

export const tupian = (fd: FormData) => {
  return request<UploadResponseType>('/v1_0/upload','POST',fd)
}